﻿// <copyright file="PathfinderNode.cs" company="Gustavo Franco">
// Copyright (c) 2006 All Right Reserved
// </copyright>
// <author>Gustavo Franco</author>
// <email>gustavo_franco@hotmail.com</email>
// <date>2006</date>
// <summary>Node in the pathfinding solution.</summary>

// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER
// REMAINS UNCHANGED.

// Email:  gustavo_franco@hotmail.com

// Copyright (C) 2006 Franco, Gustavo

// Work done by Robert Tenney on this library: PathFinder, is based off of the previous work
// done by: Franco, Gustavo.

using System;

namespace TenneySoftware.Engine.Algorithms.Pathfinder {
    /// <summary>
    /// Node in the pathfinding solution.
    /// </summary>
    [Author("Franco, Gustavo")]
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "Unneeded")]
    public struct PathfinderNode {
        /// <summary>
        /// F value for calculation.
        /// </summary>
        private int f;
        
        /// <summary>
        /// G value for calculation.
        /// </summary>
        private int g;
        
        /// <summary>
        /// H value for calculation.
        /// </summary>
        private int h;  // f = gone + heuristic
        
        /// <summary>
        /// X location.
        /// </summary>
        private int x;
        
        /// <summary>
        /// Y location.
        /// </summary>
        private int y;
        
        /// <summary>
        /// Parent X location.
        /// </summary>
        private int px; // Parent
        
        /// <summary>
        /// Parent Y location.
        /// </summary>
        private int py;

        /// <summary>
        /// Gets or sets the F value.
        /// </summary>
        /// <value>
        /// The F value.
        /// </value>
        public int F {
            get {
                return this.f;
            }

            set {
                this.f = value;
            }
        }

        /// <summary>
        /// Gets or sets the G value.
        /// </summary>
        /// <value>
        /// The G value.
        /// </value>
        public int G {
            get {
                return this.g;
            }

            set {
                this.g = value;
            }
        }

        /// <summary>
        /// Gets or sets the H value.
        /// </summary>
        /// <value>
        /// The H value.
        /// </value>
        public int H {
            get {
                return this.h;
            }

            set {
                this.h = value;
            }
        }

        /// <summary>
        /// Gets or sets the X value.
        /// </summary>
        /// <value>
        /// The X value.
        /// </value>
        public int X {
            get {
                return this.x;
            }

            set {
                this.x = value;
            }
        }

        /// <summary>
        /// Gets or sets the Y value.
        /// </summary>
        /// <value>
        /// The Y value.
        /// </value>
        public int Y {
            get {
                return this.y;
            }

            set {
                this.y = value;
            }
        }

        /// <summary>
        /// Gets or sets the PX value.
        /// </summary>
        /// <value>
        /// The PX value.
        /// </value>
        public int PX {
            get {
                return this.px;
            }

            set {
                this.px = value;
            }
        }

        /// <summary>
        /// Gets or sets the PY value.
        /// </summary>
        /// <value>
        /// The PY value.
        /// </value>
        public int PY {
            get {
                return this.py;
            }

            set {
                this.py = value;
            }
        }
    }
}
